import React, { Component } from 'react'
import { HashRouter as Router, Route, Link ,Switch} from "react-router-dom"
function Index() {
  return <h1>首页</h1>
}
function Product() {
  return <h1>产品</h1>
}
function User() {
  return <h1>用户</h1>
}
export default class App extends Component {
  render() {
    return (
      <div>
        <Router>
          <Link to="/">首页</Link>
          <Link to="/product">产品</Link>
          <Link to="/user">用户</Link>
          <Switch>
            <Route path="/" component={Index} exact></Route>
            <Route path="/product" component={Product} exact></Route>
            <Route path="/User" component={User} exact></Route>
          </Switch>
        </Router>
      </div>
    )
  }
}
